package com.young.msg.model;

import com.young.common.model.BaseDO;
import com.young.common.model.enums.ETrashFlagEnum;
import com.young.msg.model.enums.EMailStateEnum;

/**
 * 邮件发送客户端实体类
 * Created by wangjiyu on 2021-10-28.
 */
public class MailSenderConfig extends BaseDO {

    /**
     * 自增主键
     */
    private Long id;
    /**
     * 邮件发送账号标识
     */
    private String senderCode;
    /**
     * 发件人名字
     */
    private String fromName;
    /**
     * 邮箱host
     */
    private String mailHost;
    /**
     * 端口号,允许为空
     */
    private Integer mailPort;
    /**
     * 账号
     */
    private String username;
    /**
     * 密码
     */
    private String password;
    /**
     * 协议,默认smtp
     */
    private String protocol;
    /**
     * 状态
     */
    private Integer state;
    /**
     * 备注
     */
    private String remark;

    /**
     * 校验有效
     *
     * @return
     */
    public boolean dataValid() {
        return EMailStateEnum.ENABLE.eq(state) && ETrashFlagEnum.VALID.eq(getTrashFlag());
    }


    public MailSenderConfig() {
        super();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSenderCode() {
        return senderCode;
    }

    public void setSenderCode(String senderCode) {
        this.senderCode = senderCode;
    }

    public String getFromName() {
        return fromName;
    }

    public void setFromName(String fromName) {
        this.fromName = fromName;
    }

    public String getMailHost() {
        return mailHost;
    }

    public void setMailHost(String mailHost) {
        this.mailHost = mailHost;
    }

    public Integer getMailPort() {
        return mailPort;
    }

    public void setMailPort(Integer mailPort) {
        this.mailPort = mailPort;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}